package dao;

import entity.Price;
import entity.Shopping;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface ShoppingMapper {
    int deleteByPrimaryKey(Integer sid);

    int insert(Shopping record);

    int insertSelective(Shopping record);

    Shopping selectByPrimaryKey(Integer sid);

    int updateByPrimaryKeySelective(Shopping record);

    int updateByPrimaryKey(Shopping record);
    //根据获取随机数查询商品
    List<Shopping> getid(@Param("sclassification") int sclassification);
    //根据sid查询数据
    Shopping idcx(@Param("sid") int sid);
    //随机推荐商品
    List<Shopping> gettuijian();

    //添加商品至购物车
    int addShopping(@Param("price") Price price);
    //查询购物商品
    List<Price> getselect(@Param("puserid") int puserid);
    //修改商品
    int updel(@Param("puserid") int puserid,@Param("pshoppingId") int pshoppingId,@Param("pnum") int pnum);
    //查询购物车商品
    List<Shopping> getlist(@Param("uid") int uid);
    //删除购物车商品
    int getdelete(@Param("pid") int pid);

    List<Shopping> list1(@Param("chaname") String chaname,@Param("start") int start,@Param("pageSize") int pageSize);

    int listzong(@Param("chaname") String chaname);

   public Shopping xiulist(@Param("id") int id);

    int insert1(@Param("r") Shopping r);
    int del1(@Param("sid")int sid);

}